#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <stack>
#include <string>
#include <vector>
#include <queue>
#include <unordered_map>
using namespace std;

class Solution {
public:
    int minSubArrayLen(int target, vector<int>& nums) {
        int left = -1;
        int right = -1;
        int sum = 0;
        int ret = 0;
        int len = nums.size();
        while (right < len - 1)
        {
            right++;
            sum += nums[right];
            while (sum >= target)
            {
                int tmp = right - left;
                ret = (ret == 0) ? (tmp) : (min(ret, tmp));
                left++;
                sum -= nums[left];
            }
        }
        return ret;
    }
};


int main()
{
	return 0;
}
